<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Member extends Model
{
    //指定表名，模型默认会在后面加S
    protected $table = 'users';

    //主建，默认就是id
    protected $primaryKey = 'id';

    //指定允许批量赋值的字段
    protected $fillable = ['account','password','sex'];

    //自动维护时间戳,默认为true
    public $timestamps = true;
    //对维护的时间设置为unix时间戳方式写入
    protected function getDateFormat()
    {
        return time();
    }
    //对查询的时间戳不进行格式化
    protected function asDateTime($value)
    {
        return $value;
    }

    public static function getUserInfo(){
        return 'my name is liuyang';
    }
}
